package com.uwaterloo.interviewme.model;

import java.util.Map;

import com.google.gson.Gson;

/**
 * The Model object Request.
 */
public class Request {
	
	/** The params. */
	private final Map<String, String> params;
	
	/** The gson. */
	private final Gson gson = new Gson();
	
	/**
	 * Instantiates a new request from a map.
	 *
	 * @param params the params
	 */
	public Request(Map<String, String> params) {
		this.params = params;
	}
	
	/**
	 * Adds the param.
	 *
	 * @param key the key
	 * @param value the value
	 */
	public void addParam(String key, String value) {
		params.put(key, value);
	}
	
	/**
	 * Gets the gson String of the requests
	 */
	@Override
	public String toString() {
		return gson.toJson(params, params.getClass());
	}
}
